﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace restaurant
{
    public partial class MainPageRestaurant : PhoneApplicationPage
    {
        // Constructor
        public MainPageRestaurant()
        {
            InitializeComponent();
        }
        dbFunctionsRestaurant dbfuncRestaurant = new dbFunctionsRestaurant();
        dbFunctions dbfunctions = new dbFunctions();
        private void Insert2tblEMPJOB_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                dbfuncRestaurant.insert_in_empjob(1, "Manager", 17, 10);
                dbfuncRestaurant.insert_in_empjob(2, "Waiter", 12, 8);
                dbfuncRestaurant.insert_in_empjob(3, "Cashier", 25, 20);
                dbfuncRestaurant.insert_in_empjob(4, "Cook", 25, 20);
                dbfuncRestaurant.insert_in_empjob(5, "Head Chef",45, 30);
                dbfuncRestaurant.insert_in_empjob(6, "Janitor", 12, 9);
            }
            catch (Exception excep)
            {
                MessageBox.Show(excep.Message);
            }
            try
            {
                dbfunctions.insert_into_person(1, "joy", "chugh", "male", DateTime.Now.Date, 66.66f, 44.4f, 33.4f, DateTime.Now.Date, 2.0f);
            }
            catch (Exception except)
            {
                MessageBox.Show(except.Message);
            }
        }


        private void Insert2tblEMPLOYEE_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                dbfuncRestaurant.insert_in_employee(1, "john", DateTime.Parse("01/12/2009"), 12, 1);
                dbfuncRestaurant.insert_in_employee(2, "Adam", DateTime.Parse("11/11/2009"), 13, 1);
                dbfuncRestaurant.insert_in_employee(3, "Julia", DateTime.Parse("10/12/2009"), 7, 2);
                dbfuncRestaurant.insert_in_employee(4, "Amanda", DateTime.Parse("11/12/2011"), 15, 3);
                dbfuncRestaurant.insert_in_employee(5, "Gates", DateTime.Parse("11/12/2010"), 20, 2);
            }
            catch (Exception excep)
            {
                MessageBox.Show(excep.Message);
                
            }
        }

        private void Insert2tblSEATING_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                dbfuncRestaurant.insert_into_tblseating(1, "up", 2);
                dbfuncRestaurant.insert_into_tblseating(2, "down", 3);
                dbfuncRestaurant.insert_into_tblseating(3, "down", 4);
                dbfuncRestaurant.insert_into_tblseating(4, "up", 6);
                dbfuncRestaurant.insert_into_tblseating(5, "left", 4);
                dbfuncRestaurant.insert_into_tblseating(6, "left", 2);
                dbfuncRestaurant.insert_into_tblseating(7, "down", 2);
                dbfuncRestaurant.insert_into_tblseating(8, "up", 2);

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void Insert2tblCUSTBILL_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                dbfuncRestaurant.insert_into_cutomerbill(1, 1, DateTime.Parse("21:00"), DateTime.Parse("23:00"));
                dbfuncRestaurant.insert_into_cutomerbill(2, 4, DateTime.Parse("21:00"), DateTime.Parse("23:00"));
                dbfuncRestaurant.insert_into_cutomerbill(3, 2, DateTime.Parse("21:00"), DateTime.Parse("23:00"));
                dbfuncRestaurant.insert_into_cutomerbill(4, 3, DateTime.Parse("19:00"), DateTime.Parse("21:00"));
                dbfuncRestaurant.insert_into_cutomerbill(5, 2, DateTime.Parse("21:00"), DateTime.Parse("23:00"));
                dbfuncRestaurant.insert_into_cutomerbill(6, 5, DateTime.Parse("21:00"), DateTime.Parse("23:00"));
                dbfuncRestaurant.insert_into_cutomerbill(7, 4, DateTime.Parse("21:00"), DateTime.Parse("23:00"));

            }
            catch (Exception excep)
            {
                MessageBox.Show(excep.Message);
            }
        }

        private void Insert2tblMENUITEMS_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                dbfuncRestaurant.insert_into_menuitems("Pasta", 1, 10, "Entree");
                dbfuncRestaurant.insert_into_menuitems("Steak", 2, 18, "Entree");
                dbfuncRestaurant.insert_into_menuitems("Wings", 3, 9, "Appetizers");
                dbfuncRestaurant.insert_into_menuitems("Malibu", 4, 12, "Drinks");
                dbfuncRestaurant.insert_into_menuitems("Grilled Chicken", 5, 12, "Entree");
                dbfuncRestaurant.insert_into_menuitems("Chicken Potato", 6, 5, "Salads");
            }
            catch (Exception excep)
            {
                MessageBox.Show(excep.Message);
            }
        }

        private void Insert2tblITEMSORDERED_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                dbfuncRestaurant.insert_into_itemsordered(1, 2, 1);
                dbfuncRestaurant.insert_into_itemsordered(1, 2, 2);
                dbfuncRestaurant.insert_into_itemsordered(1, 1, 3);
                dbfuncRestaurant.insert_into_itemsordered(2, 2, 2);
                dbfuncRestaurant.insert_into_itemsordered(4, 2, 3);
                dbfuncRestaurant.insert_into_itemsordered(3, 2, 4);
                dbfuncRestaurant.insert_into_itemsordered(5, 2, 4);
            }
            catch (Exception excep)
            {
                MessageBox.Show(excep.Message);
            }
        }

        private void Next1_Click(object sender, RoutedEventArgs e)
        {

        }

    }
}